﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace WindowsGame4
{
    class Message
    {
        public enum MessageType { msg_move = 0, msg_delete = 1, msg_destroy = 2, msg_remove = 3, msg_stop = 4, msg_move_left = 5, msg_newShoot = 6, msg_follow = 7, msg_disableBlinking = 8, msg_attacked = 9, msg_create = 10, msg_stopApproximate = 11};
        // Emitter
        String idEmitter;
        // Receiver
        String idReceiver;
        // Message type
        MessageType type;
	    // Time left to send the message
        double timeSend;

        public Message(String idEmitter, String idReceiver, MessageType type, double timeSend)
        {
            this.idEmitter = idEmitter;
            this.idReceiver = idReceiver;
            this.type = type;
            this.timeSend = timeSend;
        }

        public String convertToString(MessageType messageType)
        {
            String message = "";
            switch (type)
            {
                case MessageType.msg_move:
                    {
                        message = "move";
                        break;
                    }
		        default:
		        {
			        message = "not valid message";
                    break;
		        }
            }
            return message;
        }

        public double TimeSend
        {
            get { return timeSend; }
            set { timeSend = value; }
        }

        public String IdReceiver
        {
            get { return idReceiver; }
            set { idReceiver = value; }
        }

        public MessageType Type
        {
            get { return type; }
            set { type = value; }
        }

        
    }
}